<script setup>
import useCopy from '../../composable/useCopy'
import useSort from '../../composable/useSort'
import useLocation from '../../composable/useLocation'

const { sort, sort_list } = useSort()

const { location, location_list } = useLocation()

const {
  handleCopy,
} = useCopy()
</script>

<template>
  <div class="search-list__header">
    <div class="header-copy">
      <el-button
        type="primary"
        size="small"
        @click="handleCopy('selected')"
      >复制选中</el-button>
      <el-button
        type="primary"
        size="small"
        @click="handleCopy('page')"
      >复制当前页</el-button>
      <el-button
        type="primary"
        size="small"
        @click="handleCopy('all')"
      >复制全部</el-button>
    </div>
    <div class="header-location">
      <el-dropdown v-model="sort">
        <el-dropdown-item
          v-for="item of sort_list"
          :key="item"
        >{{ item }}</el-dropdown-item>
      </el-dropdown>
    </div>
    <div class="header-sort">
      <el-dropdown v-model="location">
        <el-dropdown-item
          v-for="item of location_list"
          :key="item.title"
        >{{ item.title }}</el-dropdown-item>
      </el-dropdown>
    </div>
  </div>
</template>

<style lang="scss" scoped>

</style>
